Repository navigation
docs: % change and anomaly alerts on a KPI, compared with previous checks (CUB-5218) - #12306
Conversation
|
Claude finished @mngr's task in 1m 18s —— View job Approve once cubedevinc/cubejs-enterprise#16509 merges. 0 high, 0 medium, 2 low. Review details
Findings
Checked, no issues
Review threadsThe listing returned 0 of my own threads (no prior threads), so nothing was resolved or re-affirmed. |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
|
Claude finished @mngr's task in 59s —— View job Verdict: no blocking issues. 0 high, 0 medium, 1 low. Merge only after cubedevinc/cubejs-enterprise#16509, as the PR says. Review details
Checked
Low (not posted inline: this PR fixes only medium and high findings)
Review threadsThe listing returned 0 of my own unresolved threads, so none were resolved or re-affirmed. |
…ks; manage alerts from chat and the API (CUB-5218)
|
Claude finished @mngr's task in 1m 35s —— View job No blocking issues: 0 high, 0 medium, 2 low (not posted inline, since the author fixes only medium and high findings on this PR). Review details
Low
Checked, no issues
Review threadsThe listing returned 0 of my own threads (no prior threads), so none were resolved or re-affirmed. |
…esh's, never a scheduled task (CUB-5218)
|
Claude finished @mngr's task in 1m 32s —— View job No issues found (0 high, 0 medium, 0 low posted) Review details
Checked
I raised no low-severity editorial points, following the author's stated policy on this PR. Review threadsThe listing returned 0 of my own threads, so I resolved none and re-affirmed none (no prior threads). |
## Summary #12306 already added "Managing schedules from chat" to Scheduled refreshes and "Managing alerts from chat" to Data alerts. This PR now adds only what those sections leave out: - **Scheduled refreshes:** the intro links to "Managing schedules from chat". That section now says the agent needs the Explorer role as well as Edit or Manage permission on the workbook, and that it can't run a schedule now. - **Analytics Chat:** a "Schedule dashboards" line in the key features links to the section. ## Test plan - The Explorer role check: the agent's routes call the same workbook access check as the sidebar, and that check requires the Explorer role for Edit. - `mint broken-links`: no broken links on the changed pages. The one broken link it reports is in `api-reference/introduction.mdx` and is already on master. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: igorlukanin <3852894+igorlukanin@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Depends on cubedevinc/cubejs-enterprise#16509 and its part PRs cubedevinc/cubejs-enterprise#16507 (chat tools), cubedevinc/cubejs-enterprise#16508 (public API
alert), and cubedevinc/cubejs-enterprise#16825 (sidebar status retry). Do not merge this before cubedevinc/cubejs-enterprise#16509 merges. Before that, the page describes % change and Anomaly on a KPI, which the product does not yet offer.Summary
Data alerts' % change and Anomaly rules now work on a chart or KPI with no time dimension. On such a chart the alert remembers the value each check reads and compares with those values: % change with the previous check, Anomaly with the normal range of the earlier checks, once there are 8. The chat agent can list, create, change and delete a dashboard's scheduled refreshes together with their alert. The public notifications API takes an
alertfield.docs/explore-analyze/data-alerts.mdxManaging alerts from chat says the agent never makes an alert on a chart of a published dashboard into a scheduled task with a condition: the alert belongs to that dashboard's scheduled refresh.
docs/explore-analyze/scheduled-refreshes.mdx:describeSchedule→cronSentence, cronstrue;node -e "require('cronstrue').toString('0 9 * * 1-5')"→ "At 09:00 AM, Monday through Friday"), corrected here as an adjacent defect.docs/explore-analyze/scheduled-tasks.mdx→ Managing tasks from chat: when data alerts are on, an alert on a chart of a published dashboard is not a task; it belongs to that dashboard's scheduled refresh, and the agent doesn't create a task for it.api-reference/api.yaml: mirrors the regenerated public spec's change only:DataAlertRule/DataAlertRuleInputschemas and their enums;alertonNotificationDtoandUpdateNotificationInput;I produced it by running
scripts/extract-api.mjson master'sopen-api-spec-public-v3.1.yamland on the head's, then applying the difference (6 hunks). That keeps it independent of master's other unreleased spec changes, whichapi.yaml(synced per platform-client release) does not carry yet.Verified against the code
Form. On the round-2 hand-off walk (staging-mngr-6,
handoff-run-r2.log, 2026-10-19; unchanged on the round-3 and round-4 walks,handoff-run-r3.log/handoff-run-r4.log, 2026-10-21/22), a KPI with no time axis showed:The rule saved as
timeColumn: null,grain: null.Comparison.
evaluateAgainstChecks(ai-engineer/.../alerts/evaluate-alert-rule.ts):previous-zero;DATA_ALERT_ANOMALY_MIN_POINTS(8) and usesmedianMadBandover the remembered values.What is remembered.
alert-history.ts:checkPointOfremembers only a check-based verdict that read a number;appendCheckPointkeepsDATA_ALERT_CHECK_HISTORY_MAX= 30;historyFor/keepsHistorykey on rule id, series andfilterParams.prepareDataAlertRulekeeps the rule id unlessdataAlertConditionKeychanges (chart, report, measure, type, direction, percent).Live checks (walk log):
Pause and resume keeping the values: AC-5c,
verify-5-kept-through-edit-and-pause-has-3.png.Email and Slack. The en-US email keys
alertPreviousCheckValue,alertNormalRangeOfChecksandalertComparedWithPreviousChecks(cloud-router). The Slack sentence comes fromalertStatement'sbasis === 'checks'branch; its format is pinned byalert-notification.spec.ts.Sidebar strings. en-US
creatorMode.json:summary*Checks,lastCheckPreviousCheck,lastCheckBandChecks,reasonNoEarlierCheck,reasonTooFewChecks,reasonPreviousCheckZero.Chat tools.
DashboardScheduledRefreshToolsFactory.ts:recipientUserIds, or the current user when none are named; no Slack, groups or control values;useScheduledRefreshes, whichAiEngineerServicesets off for an embed session;publishedDashboardUnsafeTools;WorkbookEdit(verify-11-read-only-user-refused.png);alertCheckForViewer);recipientsWithheld: trueinstead of a recipient list (describeRecipients; console-server'sserializeScheduledRunnulls the ids unlessviewer.canEdit), and the description says never to report that as no recipients. Round-3 walk: the non-creator's chat reply named no "no recipients".Status placeholder.
NextRunCell/ the last-check cell renderPlaceholderwhilerun.isEnabled && run.isStatusPending && !run.hasStatus; a failed read leaves the run pending and joins the 5 s status poll (use-scheduled-refreshes.ts, cubedevinc/cubejs-enterprise#16825, spec AC-6g inScheduledRefreshSidebar.spec.tsx).Run now on the open card.
use-scheduled-refreshes.tskeeps polling a Run now's status until it reports the run finished, then up toRUN_NOW_CHECK_WAIT_MS(60 s) more for the stored check.Chat routing of a dashboard alert (cubedevinc/cubejs-enterprise#16507,
730cdb4add):createDashboardScheduledRefresh's description says an alert on a published dashboard's chart is always set up there;createScheduledTask's says a task condition watches a measure outside any dashboard. It adds that clause only whenuseScheduledRefreshes && useDataAlerts, hence "when data alerts are turned on";schedule-tasksskill says such an alert "is a scheduled notification on that dashboard, not a task" and points to the dashboard's schedule settings. So the page promises "never a task", not that the agent always creates the refresh itself;handoff-run-r4.log, [WALK 12], 2026-10-22): "Email me when the Orders count KPI … goes above 1000. Check every day at 9:00 UTC." madecreateDashboardScheduledRefresh1 call andcreateScheduledTask0. It created refresh 5050 with athreshold/gt/1000 alert on the KPI (timeColumn: null), and its card read "Condition: Orders Count is above 1,000 · Orders count".Public API. The regenerated
open-api-spec-public-v3.1.yamlon the feature branch.Feature PR: https://github.com/cubedevinc/cubejs-enterprise/pull/16509
Linear: https://linear.app/cube-d3/issue/CUB-5218/data-alerts-percent-change-and-anomaly-rules-for-kpi-charts